#include "led.h"

static int led_numMax = 8;

/**
 * @brief  点亮led
 * @param  void
 * @retval void
 */
void led_on(unsigned char _led_, uint32_t color)
{
	if (_led_ >= led_numMax) {
		return ;
	}

	WS_SetColor(_led_, color);
}

/**
 * @brief  熄灭led
 * @param  void
 * @retval void
 */
void led_off(unsigned char _led_)
{
	if (_led_ >= led_numMax) {
		return ;
	}
	
	WS_SetColor(_led_, 0x000000);
}

/**
 * @brief  led取反
 * @param  void
 * @retval void
 */
void led_not(unsigned char _led_, uint32_t color)
{
	if (_led_ >= led_numMax) {
		return ;
	}

	
	if (GetColor(_led_) != 0) {
		led_off(_led_);		
	} else {
		led_on(_led_, color);

	}
}

/**
 * @brief  关闭led
 * @param  void
 * @retval void
 */
void Close_led(void)
{
	WS_Clear(0x000000);
}

/******************* (C) COPYRIGHT 2023 LIUGONG*****END OF FILE************/
